

#pragma once

#include "cocos2d.h"
USING_NS_CC;

#include "type.h"
#include "cardpack.h"

#include <vector>
#include <map>

using namespace std;

class BattleScene : public CCScene, public CCTargetedTouchDelegate, public CCKeypadDelegate {
public:
	BattleScene();
	virtual ~BattleScene();

    CREATE_FUNC(BattleScene);

private:
	virtual bool init();

	void getFriends();
	void createFriendsList();

	void onAutoMatch(CCObject *sender);
	void onLadder(CCObject *sender);
	void onRecharge(CCObject *sender);
	void onViewFriendInfo(CCObject* sender);
	void onClose(CCObject* sender);

	void onAutoMatchResponse(unsigned char *data, unsigned int size);

	virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
	virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent);
	virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent);
	virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent);
	
	virtual void keyBackClicked();
	virtual void keyMenuClicked();

	virtual void onEnter();
	virtual void onExit();

private:

	CCLayer* _layer;
	CCLayer* _layerFriendList;

	CCLabelTTF* _labelMoney;

	vector<string> _friends;

	char buf[50];
};
